<?php
class Employee extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();

		// load helper
		$this->load->helper('url');
		// $this->load->library('session');

		$this->load->model("Employee_model", '', TRUE);
		$this->load->model("Department_model", '', TRUE);
	}

	public function index()
	{
		$companyId = 1;		
		$data['lstEmployee'] = $this->Employee_model->All($companyId);

		$data['mainView'] = 'employee/index';
		$this->load->view('shared/layout', $data);
	}

	public function create()
	{
		$companyId = 1;
		$data['lstDepartment'] = $this->Department_model->All($companyId);
		$data['mainView'] = 'employee/create';
		$this->load->view('shared/layout', $data);
	}	

	public function create_post()
	{
		$this->Employee_model->Add();

		redirect("/employee/index");
	}	
}
?>